<extend name="Index:base" />
<block name="title"><title>广告</title></block>
<block name="style">
 <style>
.main,.panel-default>.panel-heading{
background:none;
}
body{
background:none;
}
.panel.panel-default,.panel .panel-body,.panel .panel-heading,.table-bordered {
	border:none;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
	border:none;		
	padding:15px;	
	line-height:8px;
	height: 8px;
	border-top: 1px solid #d4d4d4;
	border-bottom: 1px solid #d4d4d4;
}
.name strong{
color:#000000;
font-size:15px;
font-weight:600;
}
.name {
	color:#20a8d8;
	font-size:12px;
}
.smallfont {
	color:#9c9c9c;
	font-size:12px;
}

.align-center{
	text-align:center; 
}
.title2{
text-align:center;
}
.table-bordered > tbody > tr .wd{
	text-align:left;	
}

.col-xs-2,.col-xs-4{
padding-right:0;
margin:10px 0;
}
.col-sm-3{
width:10%;
}
.col-sm-2{
width:8%;
}
.col-sm-1{
width:5%;
}
.col-sm-4{
width:18%;
}
.col-sm-1,.col-sm-2{
margin:16px 0;
}
.col-sm-3,.col-sm-4{
margin:10px 0;
}
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4{
padding-right:0;
}
 </style>
</block>
	<!-- start: Header -->
<block name="body">

			<!-- end: Main Menu -->
						
		<!-- start: Content -->
		<div class="main ">
		
			<div class="row">
				<div class="col-lg-12">
					<h3 class="page-header"><i class="fa fa-life-bouy"></i>广告</h3>
				</div>
			</div>

			<div class="row">
				<div class="col-md-12">
			        <div class="panel panel-default">
						<div class="panel-heading">
							
							<a class="btn btn-default " href="{:U('Index/home_ad')}" >管理</i></a>&nbsp;&nbsp;&nbsp;
							<if condition="$type eq 'h_adv_add'">
							<h2><span class="break"></span><strong>新增广告</strong></h2>
							</if>
							<if condition="$type eq 'h_adv_edit'">
							<h2><span class="break"></span><strong>编辑广告</strong></h2>
							</if>							
						</div>&nbsp;&nbsp;&nbsp;
						<div class="panel-body" style="width: 50%;">
							<form action="{:U('Index/adv_add')}" method="post" enctype="multipart/form-data" class="form-horizontal ">
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input"><font style="color:red;">*</font>&nbsp;&nbsp;广告名称：</label>
				                    <div class="col-md-9">
				                        <input type="text" id="adv_title" name="adv_title" class="form-control" value="{$adlist.adv_title}">
				                        <span class="help-block"></span>
				                    </div>
				                </div>

				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input"><font style="color:red;">*</font>&nbsp;&nbsp;图片跳转链接：</label>
				                    <div class="col-md-9">
				                        <input type="text" id="adv_url" name="adv_url" class="form-control" value="{$adlist.adv_url}">
				                        <span class="help-block"></span>
				                    </div>
				                </div>
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="email-input">&nbsp;</label>
				                    <div class="col-md-12">
				                        <img class="img-thumbnail" src="{$adlist.adv_pic}" >
				                    </div>
				                </div>									
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="email-input">广告图片上传:</label>
				                    <div class="col-md-9">
				                        <input type="file" id="file-input" name="adv_pic" >
										<span class="help-block">为确保显示效果正确，请选择最小不低于W:776px H:300px、最大不超过W:1920px H:481px的清晰图片作为全屏焦点图。</span>
				                    </div>
				                </div>
							
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input">&nbsp;&nbsp;广告位:</label>
				                    <div class="col-md-9">
				                       <select id="ap_id" name="ap_id" class="form-control" size="1">
											<if condition="$adlist.ap_id eq '0'">
												<option value="0">首页-顶部</option>
												<option value="1">首页-中部</option>
												<option value="2">首页-底部</option>
											<elseif condition="$adlist.ap_id eq '1'"/>					
												<option value="1">首页-中部</option>
												<option value="0">首页-顶部</option>
												<option value="2">首页-底部</option>
											<elseif condition="$adlist.ap_id eq '2'"/>	  <option value="2">首页-底部</option>
												<option value="1">首页-中部</option>
												<option value="0">首页-顶部</option>
												
											<else/>
												
											   <option value="0">首页-顶部</option>
												<option value="1">首页-中部</option>
												<option value="2">首页-底部</option>			   
											</if>
				                        </select>
				                    </div>
				                </div>	
								<div class="form-group">
									<label class="col-md-3 control-label" for="select">购买所支付的金额:</label>
				                    <div class="col-md-9">
				                        <input type="text" name="goldpay" class="form-control" value="{$adlist.goldpay}">
				                       
				                    </div>
								</div>
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input"><font style="color:red;">*</font>&nbsp;&nbsp;广告开始时间：</label>
				                    <div class="col-md-9">
				                        <input type="text" id="adv_start_date" name="adv_start_date" class="form-control ui_timepicker" value="<if condition="$adlist.adv_start_date neq ''">{$adlist.adv_start_date|=date('Y-m-d h:i:s',###)}</if>">
				                        <span class="help-block"></span>
				                    </div>
				                </div>
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input"><font style="color:red;">*</font>&nbsp;&nbsp;广告结束时间：</label>
				                    <div class="col-md-9">
				                        <input type="text" id="adv_end_date" name="adv_end_date" class="form-control ui_timepicker" value="<if condition="$adlist.adv_end_date neq ''">{$adlist.adv_end_date|=date('Y-m-d h:i:s',###)}</if>">
				                        <span class="help-block"></span>
				                    </div>
				                </div>
				                <div class="form-group">
				                    <label class="col-md-3 control-label" for="text-input">&nbsp;&nbsp;是否启用：</label>
				                    <div class="col-md-9">
				                       <select id="adv_states" name="adv_states" class="form-control" size="1">
											<if condition="$adlist.adv_states eq '2'">
												<option value="2">否</option>
											   <option value="1">是</option>
											<elseif condition="$adlist.adv_states eq '1'"/>
											<option value="1">是</option>
											<option value="2">否</option>
											<else/>
												
											   <option value="1">是</option>
												<option value="2">否</option>			   
											</if>
				                        </select>
				                    </div>
				                </div>								
								<br>
				            
						</div>
						<div class="panel-footer" style="border:none">
							<input type="hidden" name="type" value="{$type}"> 
							<input type="hidden" id="adv_id" name="adv_id" value="{$adlist.adv_id}">
							<input type="hidden" id="adv_type" name="adv_type" value="{$adv_type}">
		                    <button type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 确定</button>
							&nbsp;&nbsp;&nbsp;
	                        <button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> 重置</button>
		                </div>
					</form>						
			        </div>	
			    </div>			

			
			</div><!--/row-->				
			
		<!-- end: Content -->
		<br><br><br>
		
	</div><!--/container-->
	
</block>
<block name="script">
    <script type="text/javascript" src="__PUBLIC__/Home/js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Home/js/jquery-ui-1.8.17.custom.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Home/js/jquery-ui-timepicker-addon.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Home/js/jquery-ui-timepicker-zh-CN.js"></script>
    <script type="text/javascript">
    $(function () {
        $(".ui_timepicker").datetimepicker({
            //showOn: "button",
            //buttonImage: "./css/images/icon_calendar.gif",
            //buttonImageOnly: true,
            showSecond: true,
            timeFormat: 'hh:mm:ss',
            stepHour: 1,
            stepMinute: 1,
            stepSecond: 1
        })
    })
    </script>
</block>
	









